home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / Sources / FWGrInit.cpp < prev    next >
Encoding:
Text File  |  1995-11-08  |  2.3 KB  |  101 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWGrInit.cpp
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #include "FWOS.hpp"
  11.  
  12. #ifndef FWGRINIT_H
  13. #include "FWGrInit.h"
  14. #endif
  15.  
  16. #ifndef FWPRIRAS_H
  17. #include "FWPriRas.h"
  18. #endif
  19.  
  20. #ifndef FWGRGLOB_H
  21. #include "FWGrGlob.h"
  22. #endif
  23.  
  24. #ifndef FWRECT_H
  25. #include "FWRect.h"
  26. #endif
  27.  
  28. #ifndef FWGXUTIL_H
  29. #include "FWGXUtil.h"
  30. #endif
  31.  
  32. #if defined(FW_BUILD_MAC) && !defined(__WINDOWS__)
  33. #include <Windows.h>
  34. #endif
  35.  
  36. //========================================================================================
  37. //    RunTime Info
  38. //========================================================================================
  39.  
  40. #if FW_LIB_EXPORT_PRAGMAS
  41. #pragma lib_export on
  42. #endif
  43.  
  44. #ifdef FW_BUILD_MAC
  45. #pragma segment FWGraphics_Init
  46. #endif
  47.  
  48. //========================================================================================
  49. //    Globale Functions
  50. //========================================================================================
  51.  
  52. //----------------------------------------------------------------------------------------
  53. //    ::InitGraphic
  54. //----------------------------------------------------------------------------------------
  55.  
  56. void FW_FUNC_ATTR InitGraphic()
  57. {
  58. #ifdef FW_BUILD_MAC
  59.     if (FW_gScratchWindow == NULL)
  60.     {
  61.         FW_SPlatformRect rBounds(0, 0, 10 , 10);
  62.         FW_gScratchWindow = ::NewCWindow(NULL,
  63.                                         &rBounds,
  64.                                         "\p",
  65.                                         FALSE,
  66.                                         documentProc,
  67.                                         NULL,
  68.                                         FALSE,
  69.                                         0);
  70.     }
  71. #endif
  72.  
  73. #ifdef FW_SUPPORT_GX
  74.     FW_GX_Initialize();
  75. #endif
  76.  
  77.     if (FW_gRasterizer == NULL)
  78.         FW_gRasterizer = new FW_CPrivRasterizer;
  79. }
  80.  
  81. //----------------------------------------------------------------------------------------
  82. //    ::ShutdownGraphic
  83. //----------------------------------------------------------------------------------------
  84.  
  85. void FW_FUNC_ATTR ShutdownGraphic()
  86. {
  87. #ifdef FW_BUILD_MAC
  88.     FW_ASSERT(FW_gScratchWindow != NULL);
  89.     ::DisposeWindow(FW_gScratchWindow);
  90.     FW_gScratchWindow = NULL;
  91. #endif
  92.  
  93.     FW_ASSERT(FW_gRasterizer != NULL);
  94.     delete FW_gRasterizer;
  95.     FW_gRasterizer = NULL;
  96.  
  97. #ifdef FW_SUPPORT_GX
  98.     FW_GX_Terminate();
  99. #endif
  100. }
  101.